import request from '@/utils/request';

/******* 
 * @description: 发布瓶子
 * @param {*} data
 * @return {*}
 */
export function throwBottle(data) {
  return request({
    url: '/backend/bottle/throwBottle',
    method: 'post',
    data
  });
}

/******* 
 * @description: 瓶子列表
 * @param {*} params
 * @return {*}
 */
export function getBottleList(params) {
  return request({
    url: '/backend/bottle/bottleList',
    method: 'get',
    params
  });
}

/******* 
 * @description: 发布动态
 * @param {*} data
 * @return {*}
 */
export function publishTrends(data) {
  return request({
    url: '/backend/bottle//publishTrends',
    method: 'post',
    data
  });
}

/******* 
 * @description: 查询动态列表
 * @param {*} params
 * @return {*}
 */
export function getTrendsList(params) {
  return request({
    url: '/backend/bottle/trendsList',
    method: 'get',
    params
  });
}

/******* 
 * @description: 查询待审核动态列表
 * @param {*} params
 * @return {*}
 */
export function getReviewTrendsList(params) {
  return request({
    url: '/backend/trends/trendsList',
    method: 'get',
    params
  });
}

/******* 
 * @description: 审核动态
 * @param {*} params
 * @return {*}
 */
export function reviewTrend(data) {
  return request({
    url: '/backend/trends/reviewTrend',
    method: 'post',
    data
  });
}

/******* 
 * @description: 删除动态
 * @return {*}
 */
export function deleteTrends(data) {
  return request({
    url: '/backend/bottle/deleteTrends',
    method: 'post',
    data
  });
}

/******* 
 * @description: 查询待回复的瓶子
 * @return {*}
 */

export function getReplyBottleList(params) {
  return request({
    url: '/backend/bottle/chatWindowList',
    method: 'get',
    params
  });
}


/******* 
 * @description: 查看消息详情
 * @return {*}
 */

export function getMsgList(params) {
  return request({
    url: '/backend/bottle/getMsgList',
    method: 'get',
    params
  });
}

/******* 
 * @description: 发送消息
 * @return {*}
 */

export function sendMsg(data) {
  return request({
    url: '/backend/bottle/sendMsg',
    method: 'post',
    data
  });
}

/******* 
 * @description: 删除瓶子，或者拉黑用户
 * @return {*}
 */
export function deleteBottle(data) {
  return request({
    url: '/backend/bottle/deleteBottle',
    method: 'post',
    data
  });
}

export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/getUserInfo?id=${id}`,
    method: 'get',
    data
  });
}

export function deleteRole(id) {
  return request({
    url: `/vue-element-admin/role/deleteUser`,
    method: 'post',
    data: { userId: id }
  });
}
